<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@taglib uri="/billing" prefix="b"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>计费后台管理</title>
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/css/managercss.css">
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/css/wbox.css">
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery-1.4.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.form.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/wbox.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/validate.js"></script>
<script type="text/javascript">
<!--
	$(function(){
		$(".list div").mousemove(function(){
			$(this).css("background","#E3EEFF");
		}).mouseout(function(){
			$(this).css("background","");
		});

		$("#addAdminUser").click(function(){
			var wBox = $("#ajax").wBox({
				requestType: "iframe",
				iframeWH:{width:900,height:500},
				target:"<%=request.getContextPath() %>/manage/adminUserAdd.jsp",
				title: "添加新的CP"
			});
			wBox.showBox();
		});
	});

function show(userId){
	var wBox = $("#ajax").wBox({
		requestType: "iframe",
		iframeWH:{width:900,height:500},
		target:"<%=request.getContextPath() %>/admin/adminUser/view/"+userId,
		title: "查看厂商详细信息"
	});
	wBox.showBox();
}

	function updateStatus(userId,status){
		var str;
		if(status==0){
			str = "你确定解锁该用户吗?";
		}else{
			str = "你确定锁定该用户吗?";
		}
		if(confirm(str)){
			$.ajax({
				url:"<%=request.getContextPath() %>/admin/adminUser/updateStatus?userId="+userId+"&status="+status,
				type:"GET",
				success:function(flag){
					if(flag==0){
						alert("修改成功!");
						window.location.href="<%=request.getContextPath() %>/admin/adminUser${pageBean.url }&currentPage=${pageBean.currentPage}";
					}else{
						alert("修改失败!");
					}
				}
			});
		}
	}
			
//-->
</script>
</head>
<body>
<div class="information">
	<div class="title">
		用户列表
	</div>
	<form action="<%=request.getContextPath() %>/admin/adminUser" method="post">
		
		CP名称:<input name="cpname" type="text" value=""/>|合作业务线:
		<select name="bussiness">
						<option value="">请选择</option>
						<option value="SMS">SMS</option>
						<option value="MMS">MMS</option>
						<option value="IVR">IVR</option>
						<option value="视频基地">视频基地</option>
						<option value="百宝箱游戏">百宝箱游戏</option>
						<option value="G+游戏">G+游戏</option>
						<option value="动漫基地">动漫基地</option>
						<option value="阅读基地">阅读基地</option>
						<option value="MM基地">MM基地</option>
						<option value="MDO业务">MDO业务</option>
					</select>
		<input type="submit" value="查询">
		</form>
	<table align="center" width="100%">
		<tr class="list" align="center">
		<td style="width:80px;">渠道号</td>
			<td style="width:100px;">CP名称</td>
			<td style="width:100px;">合作业务线</td>
			<td style="width:60px;">分成比例</td>
			<td style="width:100px;">结算周期</td>
			<td style="width:60px;">扣量比率</td>
			<td style="width:100px;">合作的SP渠道</td>
			<td style="width:60px;">状态</td>
			<td style="width:200px;">简介</td>
			<td style="width:120px;">操作</td>
		</tr>
	
	
		<c:forEach items="${pageBean.result}" var="user" varStatus="status">
		
			<tr class="${status.index%2==0?'noselect':'select' }" align="center">
				<td style="width:80px;">${user.id}</td>
					<td style="width:100px;"><a href="<%=request.getContextPath() %>/admin/sp/spcplist?cpid=${user.id}">${user.cpname }</a></td>
					
					<td style="width:100px;">${user.bussiness }</td>
					<td style="width:60px;">${user.cpercent }</td>
					<td style="width:100px;">${user.cpcheck }</td>
					<td style="width:60px;">${user.cppercent }%</td>
					<td style="width:100px;">${user.spchannel }</td>
					<td style="width:60px;">${user.cpstatus == 1?'有效':'无效' }</td>
					<td style="width:200px;">${user.cpmemo }</td>
					<td style="width:120px;">
						<a href="#" onclick="show('${user.id }');">查看</a>
					</td>
			</tr>
		
		</c:forEach>
	</table>
	
	
	<!-- 
	<div class="listTitle">
		<ul>
			<li style="width:80px;">渠道号</li>
			<li style="width:100px;">CP名称</li>
			<li style="width:200px;">简介</li>
			<li style="width:100px;">合作业务线</li>
			<li style="width:60px;">分成比例</li>
			<li style="width:100px;">结算周期</li>
			<li style="width:60px;">扣量比率</li>
			<li style="width:100px;">合作的SP渠道</li>
			<li style="width:60px;">状态</li>
			<li style="width:120px;">操作</li>
		</ul>
		<div class="clear"></div>
	</div>
	<div class="list">
		<c:forEach items="${pageBean.result}" var="user" varStatus="status">
			<div class="noselect">
				<ul>
					<li style="width:80px;">${user.id}</li>
					<li style="width:100px;"><a href="<%=request.getContextPath() %>/admin/sp/spcplist?cpid=${user.id}">${user.cpname }</a></li>
					<li style="width:200px;">${user.cpmemo }</li>
					<li style="width:100px;">${user.bussiness }</li>
					<li style="width:60px;">${user.cpercent }</li>
					<li style="width:100px;">${user.cpcheck }</li>
					<li style="width:60px;">${user.cppercent }%</li>
					<li style="width:100px;">${user.spchannel }</li>
					<li style="width:60px;">${user.cpstatus == 1?'有效':'无效' }</li>
					<li style="width:120px;">
						<a href="#" onclick="show('${user.id }');">查看</a>
					</li>
				</ul>
				<div class="clear"></div>
			</div>
		</c:forEach>
	</div>
	 -->
	<jsp:include page="../page.jsp" flush="true"></jsp:include>
</div>
</body>
</html>